﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RBOSS.Business.Products
{
    public class Product:IProduct
    {

        public override bool Equals(object otherProduct)
        {
            if (otherProduct == null) 
                return false;
            var other = otherProduct as Product;
            if (other == null) 
                return false;
            return Equals(other);
        }

        public override int GetHashCode()
        {
            return ProductId;
        }

        public bool Equals(Product other)
        {
            if (other == null) return false;
            return (ProductId.Equals(other.ProductId));
        }


        public string Image
        {
            get; set;
        }

        public int ProductId
        {
            get; set;
        }

        public int CategoryId
        {
            get; set;
        }

        public string ProductName
        {
            get; set;
        }

        public string Description
        {
            get; set;
        }

        public decimal Price
        {
            get; set;
        }

        public int Qunatity
        {
            get; set;
        }

        public decimal Total
        {
            get { return Price*Qunatity; }
        }

        public int VendorId { get; set; }

        public int IsProductAvailable { get; set; }
    }
}
